<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id='app'></div>
    <video src="" controls="" width="800" height="600"></video>
    <script>
        let el = document.getElementById('app')
        let elShadow = el.attachShadow({mode: 'open'})
        let btn = document.createElement('button')
        btn.innerHTML = '按钮'
        btn.id = 'btn'
        btn.onclick = function(){
            console.log('点击了按钮')
        }
        elShadow.appendChild(btn)
        let b = document.querySelector('#btn')
        console.log(b)
    </script>
</body>
</html>